import API from '../../library/axios/api'
export const methods = {
    sendPlaylistData(item) {
        if (item.targetType === 1) {
            this.$bus.$emit("item", item);
        } else if (item.targetType === 3000) {
            window.open('https://music.163.com/m/at/6142f8ba89b460d1e9dd89ed')
        } else {
            this.$store.commit('playlistData/getPlaylist', item);
            this.$router.push({ name: 'Playlist' })
        }
    },
    recommendSongs() {
        API.recommend.songs().then(res => {
            this.$store.commit('recommendSongs/getRecommendSongs', res.data.dailySongs)
            localStorage.setItem('isRecommendSong', JSON.stringify(true))
            localStorage.setItem('songs', JSON.stringify(res.data.dailySongs))
            this.$router.push({
                name: 'Playlist'
            })
        })
    }
}